package frankenstein.datastructures;

import java.util.*;
public class Generation extends ParentModel {

	private Vector<Cromosome> chromosomes;
	private int id;
	long generationEliteFitness = 0;
	long generationBestFitness = 0;
	
	public Generation(){
		chromosomes = new Vector <Cromosome>();
	}
	public Vector <Cromosome> getGeneration(){
		return this.chromosomes;
		
	}
	public void setGeneration(Vector<Cromosome> newChromosomes){
		this.chromosomes = newChromosomes;
	}
	public int getId(){
		return this.id;
	}
	public void setId(int newId){
		this.id = newId;
	}
	public long getGenerationEliteFitness() {
		return generationEliteFitness;
	}
	public void setGenerationEliteFitness(long generationEliteFitness) {
		this.generationEliteFitness = generationEliteFitness;
	}
	public long getGenerationBestFitness() {
		return generationBestFitness;
	}
	public void setGenerationBestFitness(long generationBestFitness) {
		this.generationBestFitness = generationBestFitness;
	}
	
	public Generation createClone() {
		Generation clone = new Generation();
		
		for(Cromosome chromosome:chromosomes){
			clone.getGeneration().add(chromosome.createClone());
		}
		
		clone.setGenerationBestFitness(generationBestFitness);
		clone.setGenerationEliteFitness(generationEliteFitness);
		clone.setId(id);
		
		return clone;
	}
}
